import request from "@/utils/request";
import { exportFileByUrl, GetParams } from "@/utils/common.js";

// 查询
export function GetIssuerApi(params) {
  return request({
    url: "hermes/issuer/page",
    method: "get",
    params,
  });
}
// 新增
export function AddIssuerApi(data) {
  return request({
    url: "hermes/issuer",
    method: "post",
    data,
  });
}
// 编辑
export function UpdateIssuerApi(data) {
  return request({
    url: "hermes/issuer",
    method: "put",
    data,
  });
}
// 删除
export function DeleteIssuerApi(params) {
  return request({
    url: `hermes/issuer/${params.issuerId}`,
    method: "delete",
    params,
  });
}

// 客户标签
export function GetTagList(params) {
  return request({
    url: `hermes/issuer/customer/label/${params.customerId}`,
    method: "get",
  });
}

// 关键财务指标表
export function FinancialIndicator(params) {
  return request({
    url: `hermes/issuer/customer/financialIndicator/${params.customerId}`,
    method: "get",
  });
}
// 高管职位表
export function ExecutivePositions(params) {
  return request({
    url: `hermes/issuer/customer/executivePositions/${params.customerId}`,
    method: "get",
  });
}
// 未偿债券余额表
export function OutstandingBalance(params) {
  return request({
    url: `hermes/issuer/customer/outstandingBalance/${params.customerId}`,
    method: "get",
  });
}
// 舆情信息
export function PublicOpinionInformation(params) {
  return request({
    url: `hermes/issuer/customer/publicOpinionInformation/${params.customerId}`,
    method: "get",
  });
}
// 评级信息
export function RatingInformation(params) {
  return request({
    url: `hermes/issuer/ratingInformation/${params.customerId}`,
    method: "get",
    params
  });
}
// // // 评级信息
// export function RatingInformations(params) {
//   return request({
//     url: `hermes/issuer/ratingInformation/${params.customerId}${params.ratingDate ? '/' + params.ratingDate : '/'}`,
//     method: "get",
//   });
// }
// 担保信息
export function WarrantyInformation(params) {
  return request({
    url: `hermes/issuer/warrantyInformation/${params.customerId}`,
    method: "get",
});
}
// 被担保信息
export function GuaranteedInformation(params) {
  return request({
    url: `hermes/issuer/guaranteedInformation/${params.customerId}`,
    method: "get",
  });
}
// 股东信息
export function ShareholderInformation(params) {
  return request({
    url: `hermes/issuer/shareholderInformation/${params.customerId}/${params.year}`,
    method: "get",
  });
}
// 授权信息
export function CreditInformation(params) {
  return request({
    url: `hermes/issuer/creditInformation/${params.customerId}`,
    method: "get",
  });
}
// 我行授权信息
export function OurBanksCreditInformation(params) {
  return request({
    url: `hermes/issuer/ourBanksCreditInformation/${params.customerId}`,
    method: "get",
  });
}
// 查询卷源
export function BondSource(params) {
  return request({
    url: `hermes/issuer/riskAssessment/bondSource`,
    method: "get",
  });
}
// 查询挂钩曲线
export function HookCurve(params) {
  return request({
    url: `hermes/issuer/riskAssessment/hookCurve/${params.customerId}`,
    method: "get",
  });
}
// 最新风险值
export function LatestRiskValue(params) {
  return request({
    url: `hermes/issuer/riskAssessment/latestRiskValue/${params.customerId}`,
    method: "get",
    params,
  });
}
// 查询风险衡量曲线
export function RiskMeasurementCurve(data) {
  return request({
    url: `hermes/issuer/riskAssessment/riskMeasurementCurve`,
    method: "post",
    data,
  });
}
// 查询风险衡量平均值
export function RiskMeasureAverage(params) {
  return request({
    url: `hermes/issuer/riskAssessment/riskMeasureAverage/${params.customerId}`,
    method: "get",
    params,
  });
}
